import request from '@/utils/request'

// 创建报价单
export function createAppReportOrder(data) {
  return request({
    url: '/pekingfish/app-report-order/create',
    method: 'post',
    data: data
  })
}

// 更新报价单
export function updateAppReportOrder(data) {
  return request({
    url: '/pekingfish/app-report-order/update',
    method: 'put',
    data: data
  })
}

// 同意
export function consent(id, reject) {
  const data = {
    id,
    reject
  }
  return request({
    url: '/pekingfish/app-report-order/consent',
    method: 'put',
    data: data
  })
}

// 驳回修改
export function turnDown(id, reject) {
  const data = {
    id,
    reject
  }
  return request({
    url: '/pekingfish/app-report-order/turnDown',
    method: 'put',
    data: data
  })
}

// 删除报价单
export function deleteAppReportOrder(id) {
  return request({
    url: '/pekingfish/app-report-order/delete?id=' + id,
    method: 'delete'
  })
}

// 获得报价单
export function getAppReportOrder(id) {
  return request({
    url: '/pekingfish/app-report-order/get?id=' + id,
    method: 'get'
  })
}
export function getAppBiddingDetails(reportOrderNo) {
  return request({
    url: '/pekingfish/app-report-order/getAppBiddingDetails?reportOrderNo=' + reportOrderNo,
    method: 'get'
  })
}
// 获得报价单分页
export function getAppReportOrderPage(query) {
  return request({
    url: '/pekingfish/app-report-order/page',
    method: 'get',
    params: query
  })
}

// 导出报价单 Excel
export function exportAppReportOrderExcel(query) {
  return request({
    url: '/pekingfish/app-report-order/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
